home *** CD-ROM | disk | FTP | other *** search
- /*
- * MacRuntime.h -- faccess(), fcntl(), and open() mode flags
- *
- * Portions copyright American Telephone & Telegraph
- * Used with permission, Apple Computer Inc. (1985,1988,1990,1992-1994)
- * All rights reserved.
- *
- * Warning: This interface is NOT a part of the ANSI C standard.
- * We do NOT claim to be POSIX compliant.
- * If you want your code to be portable, don't use this interface.
- */
-
- /* Conditional Macros:
- * UsingStaticLibs - for CFM-68K: Insures that #pragma lib_export is never used.
- * UsingSharedLibs - for CFM-68K: Insures that all functions and data items are
- * marked as exported
- * <none> - for CFM-68K: Data items are exported using #pragma lib_export,
- * functions are not. Causes excess code to be
- * generated for data references to static libraries
- * and causes the linker to generate glue for
- * references to shared library routines.
- * The preceeding macros may not both be defined in the same compilation.
- */
- #if defined (UsingStaticLibs) && defined (UsingSharedLibs)
- #error "Only one of the conditional macros 'UsingStaticLibs' and 'UsingSharedLibs' may be defined in a compilation"
- #endif
-
- #ifndef __MACRUNTIME__
- #define __MACRUNTIME__ 1
-
- #pragma once
-
- #ifndef __TYPES__
- #include <types.h>
- #endif
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
- #ifndef __ALIASES__
- #include <Aliases.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /* Global Variables */
-
- #ifdef __CFM68K__
- #ifndef UsingStaticLibs
- #pragma lib_export on
- #endif
- #endif
-
- extern int StandAlone;
-
- #ifdef __CFM68K__
- #ifndef UsingSharedLibs
- #pragma lib_export off
- #endif
- #endif
-
- /* Utility Routines */
-
- pascal Boolean TrapAvailable (short TrapNumber);
-
- #ifdef __CFM68K__
-
- /* 68K CFM Runtime and Shared Library Utility Routines */
-
- /* LinkupQDGlobals is called from the default CFM init routine %__INIT.
- ** Please Refer to FragLoad.h for the prototype of custom init routines.
- ** If you create your own init routine you must call LinkupQDGlobals before
- ** any other code you write (and that code MAY NOT call Quickdraw)
- **
- ** LinkupQDGlobals purpose is to create a linked list of all the "per context"
- ** A5 Worlds in a given application context so that QuickDraw will find a
- ** "QD globals" pointer at A5+0 no matter which A5World is currently ref'd by A5.
- **
- ** The linked list built by LinkupQDGlobals uses the lomem global CurrentA5
- ** and builds the list thru the qd Globals pointers at A5+0, IF InitGraf() has
- ** NOT yet been called; Otherwise LinkupQDGlobals just copies the value of the
- ** QuickDraw globals pointer (at the location pointed to by CurrentA5) into
- ** the A5+0; i.e. into the A5World of the code fragment containing LinkupQDGlobals.
- **
- ** LinkupQDGlobals is and MUST REMAIN a staticly linked routine, called by the
- ** init routine of each separate code fragment. It may not be exported or shared.
- **
- ** LinkupQDGlobals will only return an error if it is called and the A5World
- ** referenced by the lomem pointer CurrentA5 is NOT a NuRuntime A5World AND
- ** QuickDraw has NOT been initialized. This condition can occur ONLY if an
- ** "old"/"Classic" 68K model application is attempting to use the CFM API directly.
- **
- ** The routine BindQDGlobalsList must be called IMMEDIATELY before the application
- ** initialization call of QuickDraw's InitGraf() routine, WITH THE SAME parameter
- ** passed to InitGraf. BindQDGlobalsList resolves the linked list of A5Worlds
- ** created by LinkupQDGlobals. This will cause all the A5Worlds to have a valid
- ** pointer at A5+0 to the same QuickDraw Globals.
- **
- ** Shared Libraries that have "Global" sharing (i.e 1 copy of data in system heap)
- ** must have customized Init Routines and probably will require a private copy of
- ** the quickdraw globals that are created manually and A5+0 initialized without
- ** calling QuickDraw's InitGraf() IF such libraries are to call QuickDraw (directly
- ** or indirectly) at all. The most likely case of a "data only" globally shared
- ** fragment will not need to have an init routine that fixes up A5+0, since no code
- ** will ever execute with A5 referencing its A5World.
- **
- */
-
- pascal OSErr LinkupQDGlobals(void);
- pascal void BindQDGlobalsList(void* globalPtr);
-
- #ifdef UsingSharedLibs
- #pragma lib_export off
- #endif
-
- #endif
-
- #ifdef __cplusplus
- }
- #endif
- #endif